<template>
  <!-- 回款信息 -->
  <div id="collectDetail">
    <el-form :model="form" label-width="100">
      <!-- <el-form-item label="回款编号:">
        <p>{{ form.repaymentNum }}</p>
      </el-form-item> -->
      <el-form-item label="收款名称:">
        <p>{{ form.paymentName }}</p>
      </el-form-item>
      <el-form-item label="类型:">
        <p v-if="form.paymentType == 1">合同收款</p>
        <p v-if="form.paymentType == 2">其他收款</p>
        <p v-if="form.paymentType == 3">客户收款</p>
      </el-form-item>
      <!-- <el-form-item label="合同:" v-if="form.paymentType == 1">
        <p @click="toContractDeatil" class="click">{{ form.contractName }}</p>
      </el-form-item> -->
      <el-form-item label="客户:" v-if="form.paymentType == 3">
        <p @click="toCustomerDeatil" class="click">{{ form.customerName }}</p>
      </el-form-item>
      <el-form-item label="收款金额:">
        <p>{{ form.money }}元</p>
      </el-form-item>
      <el-form-item label="收款方式:">
        <p>{{ form.repaymentTypeName }}</p>
      </el-form-item>
      <el-form-item label="收款账号:">
        <p>{{ form.account }}</p>
      </el-form-item>
      <el-form-item label="收款日期:">
        <p>{{ form.repaymentTime }}</p>
      </el-form-item>
      <el-form-item label="备注:">
        <p>{{ form.remark }}</p>
      </el-form-item>
      <el-form-item label="附件:" style="width: 100%">
        <other-files
          ref="otherFiles"
          :files="form.otherFileList || []"
        ></other-files>
      </el-form-item>
      <el-form-item label="收款状态:">
        <p v-if="form.paymentStatus == 1" style="color: #67c23a">已收款</p>
        <p v-if="form.paymentStatus == 0" style="color: #f56c6c">未收款</p>
      </el-form-item>
      <!-- <el-form-item label="审核状态:" v-if="isReloadData">
        <p v-if="form.status == 0" style="color: #e6a23c">待审核</p>
        <p v-if="form.status == 1" style="color: #67c23a">通过</p>
        <p v-if="form.status == 2" style="color: #f56c6c">未通过</p>
      </el-form-item> -->
      <el-form-item label="创建时间:">
        <p>{{ form.createTime }}</p>
      </el-form-item>
      <el-form-item label="修改时间:" v-if="form.updateTime">
        <p>{{ form.updateTime }}</p>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
import otherFiles from '@/components/otherFiles'
export default {
  name: 'collectDetail',
  data () {
    return {
      // form: {},
      isReloadData: true//局部刷新标识
    }
  },
  components: {
    otherFiles,
  },
  props: {
    form: {
      type: Object,
      required: true,
      default: () => {
        return {}
      }
    }
  },
  methods: {
    toContractDeatil () {
      this.$router.push({
        path: '/contract/contractManagement/contractDetail',
        query: {
          id: this.form.contractId
        }
      })
    },
    toCustomerDeatil () {
      this.$router.push({
        path: '/customer/customerManagement/customerDetail',
        query: {
          id: this.form.customerId
        }
      })
    },
    relodPart () {
      this.isReloadData = false
      this.$nextTick(() => {
        this.isReloadData = true
      })
    }
  }
}
</script>
<style lang='scss' scoped>
</style>